#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void res(vector<int>& scr,vector<int>& qes)
{
	vector<int> at;
	vector<bool> flag(qes.size(),false); 
	for(int i = 0;i < qes.size();i++)
	{
		for(int j = 0;j < scr.size();j++)
		{
			if(scr[j] == qes[i])
			{
				at.push_back(j);
				flag[i] = true;
			}
		}
	}
	for(int i = 0;i < at.size();i++)
	{
		if(flag[i])
		{
			cout << qes[i] << "found at" << at[i] << endl;
		}
		else
		{
			cout << qes[i] << "not found" << endl;
		}
	}
	for(auto j : at)
	{
		cout << j << ' ' ;
	}
	cout << endl;
	for(auto j : flag)
	{
		cout << j << ' ';
	}
}
	

int main()
{
	vector<int> arr;
	//先进行对应参数的输入
	int n = 0;
	int q = 0;
	cin >> n >> q;
	for(int i = 0;i < n;i++)
	{
		int tem = 0;
		cin >> tem;
		arr.push_back(tem);
	}
	//输入对应的问题
	vector<int> qes;
	for(int i= 0;i< q;i++)
	{
		int tem = 0;
		cin >> tem;
		qes.push_back(tem);
	}
	sort(arr.begin(),arr.end());
	for(auto i : arr)
	{
		cout << i << ' ';
	}
	cout << endl;
	for(auto i : qes)
	{
		cout << i << ' ';
	}
	cout << endl;
	res(arr,qes);
	return 0;
}

